package com.example.utils;

import lombok.extern.slf4j.Slf4j;

import java.util.UUID;
import java.util.concurrent.atomic.AtomicLong;

@Slf4j
public class CreateID {

    private static final AtomicLong counter = new AtomicLong(System.currentTimeMillis());

    public static String createUniqueID() {
        log.info("生成id");
        long currentTime = System.currentTimeMillis();
        long uniqueID = counter.getAndIncrement();
        String id= Long.toString(currentTime) + Long.toString(uniqueID);
        return id.substring(1,16);
    }
}
